home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!news
- From: Richard Steadman <rsteadma@mmltd.com>
- Newsgroups: comp.lang.c
- Subject: Re: The size of a file
- Date: 30 Jan 1996 15:56:47 GMT
- Organization: Micromedia
- Message-ID: <4elf3v$s5o@noc.tor.hookup.net>
- References: <4ebc03$4gv@gate.compart.fi> <59.28250.5782@windmill.com>
- NNTP-Posting-Host: keeper.mmltd.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- charlie.brown@windmill.com (Charlie Brown) wrote:
- >F>This is driving me nuts. I can't find a simple way to get the size of a
- > >disk file. This must be possible using the standard C library, but I
- > >haven't figured out how!
- >
- >This works with MSC, Borland may have a different name
- >for _dos_findfirst().
- >
- >#include <dos.h>
- >long fsize(filespec)
- >char *filespec;
- >{
- > struct find_t fileinfo;
- >
- > if(0 == _dos_findfirst(filespec,0,&fileinfo))
- > return fileinfo.size;
- > else
- > return 0L;
- >}
- >---
-
- But there's no way to get the file size if its length is greater
- than will fit in a long int?
-
-
-